package com.sixth.volunteerservicesystem.ServiceImpl;


import com.sixth.volunteerservicesystem.Dao.LearnTheoryRepository;
import com.sixth.volunteerservicesystem.Service.LearnTheoryservice;
import com.sixth.volunteerservicesystem.domain.Theory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LearnTheoryserviceimpl implements LearnTheoryservice {
    @Autowired
    LearnTheoryRepository learnTheoryRepository;
    @Override
    public void save(Theory theory) {
        learnTheoryRepository.save(theory);
    }

    @Override
    public List<Theory> list() {
        return learnTheoryRepository.findAll();
    }

    @Override
    public Theory getone( int id) {
        return learnTheoryRepository.getOne(id);
    }

    @Override
    public void delete(int id) {
        learnTheoryRepository.deleteById(id);
    }
}
